import * as actionType from './actionTypes'
import axios from 'axios'



export const login = (data) => ({
    type:actionType.CHANGE_LOGIN,
    data
})


export const logout = (data) => ({
    type:actionType.CHANGE_LOGOUT,
    data
})


export const goLogin = () => {
    return (dispatch) => {
        axios.get('/login.json').then(res => {
            const data = res.data.data
            dispatch(login(data))
        })
    }
}
